body {
  font: 14px/1.5 Helvetica Neue, Helvetica, Arial, Microsoft Yahei, Hiragino Sans GB, Heiti SC, WenQuanYi Micro Hei, sans-serif;
  color: #333;
  background-image: url("../../images/IndexBackground.png");
  min-width: 1226px;
  margin: 0;
}

.product-thumbnail {
  width: 50px;
  /* 控制缩略图宽度 */
  height: 50px;
  /* 保持高度一致 */
  object-fit: cover;
  /* 让图片填充整个框，避免变形 */
  border-radius: 5px;
  /* 让图片有一点圆角，更美观 */
  border: 1px solid #ddd;
  /* 添加边框以区分图片 */
  padding: 2px;
  /* 让图片和边框之间有点间距 */
}

.product-thumbnail:hover {
  transform: scale(1.5);
  /* 悬停时放大 1.5 倍 */
  transition: transform 0.3s ease-in-out;
  /* 平滑过渡 */
}


/* 标题样式增强 */
h1 {
  font-size: 36px;
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 600;
  text-align: center;
  margin: 40px 0;
  letter-spacing: 1.5px;
  color: #2c3e50;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* 分类容器居中 */
.category-panel {
  display: flex;
  gap: 15px;
  margin: 20px auto;
  justify-content: center;
  padding: 15px 0;
  max-width: 1200px;
}

/* 主分类样式优化 */
.main-category {
  padding: 16px 32px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.main-category:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.main-category.active {
  border-color: #2196F3;
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white;
}

/* 子分类样式优化 */
.subcategory-panel {
  display: none;
  gap: 12px;
  margin: 20px auto;
  justify-content: center;
  max-width: 1200px;
}

.subcategory-panel.active {
  display: flex;
  flex-wrap: wrap;
}

.subcategory {
  padding: 10px 24px;
  border: 1px solid #eee;
  border-radius: 25px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  font-size: 14px;
  color: #666;
}

.subcategory.active {
  background: #2196F3;
  color: white;
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
  transform: scale(1.05);
}


/* 商品表格样式 */
#productTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  display: none;
}

#productTable.active {
  display: table;
}

#productTable th,
#productTable td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
}

/* 新增样式 */
.empty-message {
  text-align: center;
  color: #666;
  padding: 20px;
  border: 1px solid #eee;
  background: #f9f9f9;
  margin-top: 10px;
}

.error-message {
  color: #dc3545;
  background: #f8d7da;
  padding: 10px;
  margin: 10px 0;
  border-radius: 4px;
}

/* 修改表格显示方式 */
#productTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  /* 默认显示表格 */
  display: table;
}

#productTable th {
  background: #fdd83544;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .category-panel {
    flex-wrap: wrap;
    padding: 10px;
  }

  .main-category {
    padding: 12px 24px;
    font-size: 14px;
  }

  .subcategory {
    padding: 8px 18px;
    margin: 5px;
  }

  h1 {
    font-size: 28px;
    margin: 30px 0;
  }
}

/* 新增细节样式 */
.main-category.active::after {
  content: "▶";
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.8;
}

.subcategory.active::after {
  content: "✓";
  margin-left: 6px;
  font-weight: bold;
}

/* 新增商品按钮样式 */
#addProductBtn {
  margin: 20px 0;
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  position: fixed;
  /* 改为固定定位 */
  left: 50%;
  /* 水平居中 */
  top: 10%;
  /* 初始位置调整为顶部 20% */
  transform: translateX(-50%);
  /* 微调水平居中 */
  padding: 20px;
  width: 80%;
  max-width: 500px;
  border-radius: 5px;
  /* 移除原 margin: 15% auto */
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  cursor: pointer;
}

.form-group {
  margin: 15px 0;
}

.form-group label {
  display: inline-block;
  width: 100px;
}

.form-group input,
.form-group select {
  width: 200px;
  padding: 5px;
}

.form-actions {
  margin-top: 20px;
  text-align: right;
}

#imagePreview {
  margin-top: 10px;
  max-width: 200px;
}

.preview-image {
  max-height: 150px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
}

.upload-progress {
  margin-top: 5px;
  height: 20px;
  background-color: #f1f1f1;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: #4CAF50;
  transition: width 0.3s ease;
}

/* 编辑模态框特有样式 */
#currentImagePreview img {
  max-width: 200px;
  border: 2px solid #ddd;
  margin: 10px 0;
}

#editImagePreview {
  margin-top: 10px;
}

/* 操作按钮系统 */
#productList button {
  /* 基础样式 */
  min-width: 80px;
  padding: 8px 20px;
  border: 2px solid transparent;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  margin: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 编辑按钮 */
#productList button:first-child {
  background: linear-gradient(145deg, #fff3e0 30%, #ffecb3 100%);
  border-color: #fbc02d;
  color: #6d4c41;
}

/* 删除按钮 */
#productList button:last-child {
  background: linear-gradient(145deg, #fdd835 0%, #fbc02d 100%);
  color: #fff;
  border-color: #fdd835;
}

/* 悬停状态 */
#productList button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 激活状态 */
#productList button:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

/* 禁用状态 */
#productList button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: #e0e0e0;
  color: #9e9e9e;
  border-color: #bdbdbd;
}

/* 加载动画 */
@keyframes button-loading {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.button-loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: button-loading 1s linear infinite;
}